function _Cast(spell,unit)
	ccrCast(spell, unit)
end

function ccrCast(spell, unit)
	if tonumber(spell) == nil then
		-- Non-numeric spell
		if unit == nil then
			CastSpellByName(spell)
		else
			CastSpellByName(spell, unit)
		end
	else
		-- Shapeshift returns an invalid name to use
		if spell == CAT_FORM
		or spell == BEAR_FORM
		then
			CastSpellByID(spell)
			return
		end
		-- spell is numeric so call it by ID
		if unit == nil then
			local vSpell = {GetSpellInfo(spell)}
			CastSpellByName(vSpell[1])
			--CastSpellByID(spell)
			return
		else
			local vSpell = {GetSpellInfo(spell)}
			CastSpellByName(vSpell[1], unit)
			--CastSpellByID(spell, unit)
			return
		end		
	end
end

function _CastAttack(spell,unit)
	ccrCastAttack(spell, unit)
end

function ccrCastAttack(spell, unit)
	-- No target used so use our current Target
	if unit == nil then objUnit = Target end
	if type(unit) == "string" then objUnit = GetObjectFromUnitID(unit) end
	if type(unit) == "table" then objUnit = unit end
	if tonumber(spell) ~= nil then spell = SpellIDToName(spell) end

	-- Check for a valid target
	if objUnit
	and objUnit:Exists()
	and not objUnit:IsDead()
	and Player:CanAttack(objUnit)
	and not ccrPlayerIsCastingOrChanneling()
	then
		-- Check Line of Sight
		if ccRS.Check_Line_Of_Sight then
			local vInLOS
			vInLOS = objUnit:InLineOfSight()
			-- Line of Sight Fuckups
			for i = 0, # InLineOfSightList do 
				if ccrTargetName() == InLineOfSightList[i] then vInLOS = true end;
			end
			if vInLOS then
				if not ccrPlayerIsInStealth() then StartAttack() end
				ccrCast(spell, objUnit) 
			end
		else
			if not ccrPlayerIsInStealth() then StartAttack() end
			ccrCast(spell, objUnit)
		end
	end
end

function _CastBuffIfMissing(spell)
	ccrCastBuffIfMissing(spell)
end

function ccrCastBuffIfMissing(spell)
	if tonumber(spell) ~= nil then spell = SpellIDToName(spell) end
	if UnitBuff("player", spell) == nil then
		ccrCast(spell, "player")
	end
end

function _CastBuffOnSelf(spell)
	ccrCastBuffOnSelf(spell)
end

function ccrCastBuffOnSelf(spell)
	if tonumber(spell) ~= nil then spell = SpellIDToName(spell) end
	ccrCast(spell, "player")
end